With the constant development of terminal technologies, a growing number of functions can be implemented by using third-party applications installed on a terminal. The third-party applications usually involve the privacy and property security of a user when performing information interaction with the terminal. Moreover, when performing data interaction with the terminal, the third-party applications usually need to obtain a public key of a terminal key to encrypt and decrypt data. Therefore, generating a key with higher security has become one of important methods for improving the security of the terminal.
In conventional technologies, a key provider server generates a terminal key by calling a driver interface that generates the terminal key. However, with this key-generating method, after a terminal is delivered, the driver interface that generates the terminal key is exposed outside. A malicious program or individual can find a command identification code corresponding to the driver interface and, according to the command identification code, call the driver interface that generates the terminal key to modify the terminal key that has been generated and stored. This causes a private key of the terminal key to be not paired with a public key of the terminal key, and hence all operations related to the terminal key cannot be performed, leading to a relatively low security of the terminal.